﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FirstBugTimeReport.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.UserModel.FirstBugTimeReport" %>


<%if(showchart==1){ %>
<html>
    <head>
        <script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
        <script type="text/javascript" src="../Highcharts/js/highcharts.js"></script>
        <script type="text/javascript" src="../Highcharts/js/themes/grid.js"></script>
        <script type="text/javascript">
        var FirstBugTimeReportchart;
        $(document).ready(function () {
            FirstBugTimeReportchart = new Highcharts.Chart({
                chart: {
                    renderTo: 'FirstBugTimeReportcontainer',
                    defaultSeriesType: 'line'
                },
                title: {
                    text:  '<%=Year %>'+'年机器第一次故障平均时间'
                },
                xAxis: {
                    categories: <%=GetReport2JSCategories() %>
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: ''
                    }
                },
                legend: {
              
                },
                tooltip: {
                    valueDecimals: 2,
                    formatter: function () {
                        return this.x + this.series.name+ this.y ;
                    }
                },
                plotOptions: {
                    line: {
                        dataLabels: {
                            enabled: false
                        }
                    }
                },
                series:  <%=GetReport2JSSeries() %>
            });
        });

        </script>
    </head>

    <body>
    <div id="FirstBugTimeReportcontainer" style=" width:380px; height:300px; margin: 0 auto"></div>
    </body>
</html>

<%}else{ %>

<form id="pagerForm" method="post" action="UserModel/FirstBugTimeReport.aspx">
<input type="hidden" name="Year" value="<%=Year %>" />
<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
</form>
<form id="FirstBugTimeReportform1" runat="server" method="post" action="UserModel/FirstBugTimeReport.aspx" onsubmit="return navTabSearch(this);">
<div class="pageHeader">
    <div class="searchBar">
        
        <table class="searchContent">
            <tr>
                <td>
                    请选择需要统计的年份:
                </td>
                <td>                   
                    <select name="Year" class="combox" onchange="return navTabSearch(FirstBugTimeReportform1)">
                        <%=GetYearList()%>
                    </select>
                </td>
                <td>
                  &nbsp;
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="pageContent">
    
    <table layouth="60">
        <tr>
            <td  valign="top">
                 <asp:repeater id="rpMenu" runat="server">
                    <HeaderTemplate>
                        <table class="table" width="100%"  >
                        <thead>                                                                                                   
                            <tr>
                                <th width="70" >
                                    月份
                                </th>
                                <th  width="180" >
                                    平均第一次故障时间/小时
                                </th>    
                                <th>交机台数</th>
                                <th>故障台数</th>
                            </tr>
                        </thead>
                        <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <%# Eval("月份")%>
                            </td>
                            <td><%# Convert.ToDecimal(Eval("平均故障时间")).ToString("F2")%></td>
			                <td> <%# Eval("交机台数")%></td>
                            <td> <%# Eval("故障台数")%></td>
		                </tr>
                    </ItemTemplate>
                    <FooterTemplate>                                                          
                            <tr>
                                <td colspan="2">总平均故障时间:<b style="color:red;"><%=Convert.ToDecimal(SUMDT.Rows[0]["总平均故障时间"]).ToString("F2")%></b></td>
                                <td>总交机台数:<b style="color:red;"><%=Convert.ToDecimal(SUMDT.Rows[0]["总交机台数"]).ToString("F2")%></b></td>
                                <td>总故障台数:<b style="color:red;"><%=Convert.ToDecimal(SUMDT.Rows[0]["总故障台数"]).ToString("F2")%></b></td>
                              
                            </tr>
                        </tbody>
                        </table>
                    </FooterTemplate>
                </asp:repeater>            
            </td>
            <td valign="top">
                <iframe width="400" height="420" frameborder="0" src="UserModel/FirstBugTimeReport.aspx?Year=<%=Year %>&showchart=1"></iframe>                   
            </td>
        </tr>
    </table>
   
</div>


</form>
<%} %>